package scottb.flex.test;

import scottb.flex.*;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class MessagePopUp extends FlexPopUp {

    private Group header = new Group().width(400).height(20);
    private Group content = new Group().width(400).height(50);
    private Group footer = new Group().width(400).height(30);

    private FlexButton closeButton = new FlexButton("close");

    public MessagePopUp() {

        VGroup vgroup = new VGroup().center().border(0x333333).background(0xFFFFFF).backgroundAlpha(.7).cornerRadius(10);

        header.add(new FlexLabel("Message").verticalCenter(0).left(10));
        vgroup.add(header);

        content.add(new FlexLabel("This is a message").top(10).left(10));
        vgroup.add(content);

        closeButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
                close();
            }
        });
        footer.add(closeButton.center());
        vgroup.add(footer);

        add(vgroup);
    }
}
